home *** CD-ROM | disk | FTP | other *** search
- class classes.shots.SpaceManALaser
- {
- var x;
- var y;
- var id;
- var dir;
- var frame;
- var clip;
- var xMov = 0;
- var yMov = 0;
- var Name = "spaceManALaser";
- var power = 30;
- var yank = false;
- function SpaceManALaser(px, py, pframe, pdir, pid)
- {
- this.x = px;
- this.y = py;
- this.id = pid;
- this.dir = pdir;
- this.frame = pframe;
- _root.d = _root.d + 1;
- this.clip = _root.attachMovie("spaceManALaser","spaceManALaser" + this.id + "Clip",_root.d);
- this.clip._x = this.x;
- this.clip._y = this.y;
- this.clip.id = this.id;
- this.yMov = 0;
- this.xMov = this.dir != "L" ? 18 : -18;
- this.clip.gotoAndStop(this.frame / 4);
- this.xMov *= _root.dif.speed;
- this.yMov *= _root.dif.speed;
- }
- function hit()
- {
- this.yank = true;
- }
- function main()
- {
- this.xMov *= 1.02;
- if(this.clip.hitTest(_root[_root.char + "Clip"]))
- {
- _root[_root.char].hit(this.xMov,this.yMov,100,this.power);
- this.yank = true;
- }
- if(this.x > 1050 || this.x < -50 || this.y > 650 || this.y < -50)
- {
- this.yank = true;
- }
- this.x += this.xMov;
- if(this.yank)
- {
- _root.removeEnemyShot("spaceManALaser" + this.id);
- this.yank = false;
- }
- this.clip._x = this.x;
- this.clip._y = this.y;
- }
- }
-